---
feature_name: Web Bluetooth / Notifications
chrome_version: 48
check_min_version: true
feature_id: 5264933985976320
icon_url: icon.png
index: index.html
---

{% include_relative _includes/intro.html %}

<p>This sample illustrates the use of the Web Bluetooth API to start and stop
characteristic notifications from a nearby Bluetooth Low Energy Device. You may
want to try this demo with the BLE Peripheral Simulator App
from the <a target="_blank"
href="https://play.google.com/store/apps/details?id=io.github.webbluetoothcg.bletestperipheral">Google
Play Store</a> and check out the <a href="notifications-async-await.html">Notifications (Async Await)</a>
sample.</p>

<form>
  <input id="service" type="text" list="services" autofocus placeholder="Bluetooth Service">
  <input id="characteristic" type="text" list="characteristics" placeholder="Bluetooth Characteristic">
  <button id="startNotifications">Start notifications</button>
  <button id="stopNotifications">Stop notifications</button>
</form>

{% include_relative _includes/datalist-services.html %}
{% include_relative _includes/datalist-characteristics.html %}

{% include output_helper.html %}

{% include js_snippet.html filename='notifications.js' %}

<script>
  document.querySelector('#startNotifications').addEventListener('click', function(event) {
    event.stopPropagation();
    event.preventDefault();

    if (isWebBluetoothEnabled()) {
      ChromeSamples.clearLog();
      onStartButtonClick();
    }
  });
  document.querySelector('#stopNotifications').addEventListener('click', function(event) {
    event.stopPropagation();
    event.preventDefault();

    if (isWebBluetoothEnabled()) {
      onStopButtonClick();
    }
  });
</script>

{% include_relative _includes/utils.html %}
